﻿/* Author: Achim Schnell */

using System;
namespace AppFx.Tokenization
{
    /// <summary>
    /// A token consisting of parsed text.
    /// </summary>
    public class Token : IToken
    {
        #region Properties

        /// <summary>
        /// Gets the content of the token.
        /// </summary>
        public string Content { get; protected set; }

        /// <summary>
        /// Gets the type of the token..
        /// </summary>
        public eTokenType Type { get; protected set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Token"/> class.
        /// </summary>
        /// <param name="content">The content of the token.</param>
        /// <param name="type">The type of the token..</param>
        public Token(string content, eTokenType type)
        {
            Content = content;
            Type = type;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return String.Format("\"{0}\" : [{1}]", Content, Type);
        }

        #endregion
    }
}
